package com.dy.course.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.alibaba.fastjson.JSON;
import com.dy.course.common.BaseController;
import com.dy.course.common.ResponseMessage;
import com.dy.course.entity.DepartmentQueryInfo;
import com.dy.course.model.Department;
import com.dy.course.service.IDepartmentService;

@Controller
public class DepartmentController extends BaseController{

	
	@Autowired
	private IDepartmentService departmentService;
	/**
	 * 
	 * 查询部门信息
	 * 1.学校
	 * 2.院系
	 * 3.专业
	 * 
	 * @param query
	 * @return
	 */

	@RequestMapping(value="/department/list")
	@ResponseBody
	public ResponseMessage<List<Department>> queryDepartmentList(DepartmentQueryInfo query){
		logger.info("【根据上级查下级,专业,院系,学校,班级】参数信息,query = "+JSON.toJSONString(query));
		return constructResponse(departmentService.getSubList(query));
	}
	
	
	
}
